class CategoryData {
  CategoryData({
    required this.code,
    required this.msg,
    required this.data,
  });

  final int code;
  final String msg;
  final List<Category> data;

  factory CategoryData.fromJson(Map<String, dynamic> json) => CategoryData(
    code: json['code'],
    msg: json['msg'],
    data: List<Category>.from(json['data'].map((x) => Category.fromJson(x))),
  );

  Map<String, dynamic> toJson() => {
    'code': code,
    'msg': msg,
    'data': List<dynamic>.from(data.map((x) => x.toJson())),
  };
}

class Category {
  Category({
    required this.createTime,
    required this.id,
    required this.title,
  });

  final String createTime;
  final int id;
  final String title;

  factory Category.fromJson(Map<String, dynamic> json) => Category(
    createTime: json['createTime'],
    id: json['id'],
    title: json['title'],
  );

  Map<String, dynamic> toJson() => {
    'createTime': createTime,
    'id': id,
    'title': title,
  };
}
